<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        /**
         * 1.["xiaoshuo","ss","sfff","fe"]
         * 2.item的首字母大写["Xiaoshuo","Ss","Sfff","Fe"]
         * 3.数组拼接成字符串
        */
       let arr = str.split("-")

       for(i in add){
        arr[i] = arr[i][0].toUpperCase()+arr[i].substr(1)
       }
       str = arr.join("-")
       console.log(str);
       
        
    </script>
</body>

</html>